package com.tangxz.service;

import com.spring.*;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/06/15 16:37
 */
@Component("userService")
@Scope("prototype")//原型Bean，非单例
public class UserService implements UserServiceI, BeanNameAware, InitializingBean {

    @Autowired
    private OrderService orderService;

    private String beanName;


    public void test() {
        System.out.println(orderService);
        System.out.println(beanName);
    }

    @Override
    public void setBeanName(String name) {
        beanName = name;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("xxx");
        System.out.println("给属性赋值、验证属性是否复合要求");
    }
}
